﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;
using Dao;

namespace Service.Interface
{
    public interface IPageService : IService<Page>
    {
        /// <summary>
        /// 获取页分页集合
        /// </summary>
        /// <param name="areaID">分区ID</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="pageCount">总页数</param>
        /// <param name="sortType">排序类型</param>
        /// <returns></returns>
        IList<Page> LoadAllByPage(int areaID, int pageIndex, int pageSize, out int pageCount, string sortType);

        /// <summary>
        /// 获取共享页的分页集合
        /// </summary>
        /// <param name="pageIndex">页索引</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="pageCount">总页数</param>
        /// <returns></returns>
        IList<Page> LoadAllSharePage(int pageIndex, int pageSize, out int pageCount);

        /// <summary>
        /// 获取共享页的分页集合
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="pageCount">总页数</param>
        /// <returns></returns>
        IList<Page> LoadAllSharePage(int userID, int pageIndex, int pageSize, out int pageCount);

        /// <summary>
        /// 更新页是否扔进垃圾箱
        /// </summary>
        /// <param name="pageID">页ID</param>
        /// <param name="delete">是否删除</param>
        void UpdatePageMarkDelete(object pageID, bool delete);

        /// <summary>
        /// 共享笔记本
        /// </summary>
        /// <param name="pageID">页ID</param>
        /// <param name="share">是否共享</param>
        void UpdatePageShare(object pageID, bool share);

        /// <summary>
        /// 获取页集合
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="delete">是否删除</param>
        /// <returns></returns>
        IList<Page> LoadAllPage(object userID, bool delete);

        /// <summary>
        /// 保存页并增加分区中的页数
        /// </summary>
        /// <param name="page"></param>
        void SaveAndAddPageCount(Page page);

        /// <summary>
        /// 删除页并减少分区中的页数
        /// </summary>
        /// <param name="page"></param>
        void DeleteAndMinusPageCount(object pageID);
    }
}
